package com.taotao.config;

import com.alibaba.csp.sentinel.adapter.servlet.callback.RequestOriginParser;
import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletRequest;

/**
 * @author wangjin
 * @title: IpLimiter
 * @projectName sw-gateway
 * @description:根据用户在请求头中的ip设置黑白名单
 * @date 2021/12/21 11:14
 */
@Component
public class IpLimiter implements RequestOriginParser {
    @Override
    public String parseOrigin(HttpServletRequest httpServletRequest) {
        return httpServletRequest.getRemoteAddr();
    }
}
